package com.itheima;

/**
 * @Author: Ethan Yankang
 * @Program: JAVA核心技术
 * @Date: 2024-08-09 17:07
 **/
class Animal {
    void makeSound() {
        System.out.println("Animal makes a sound");
    }
}

class Dog extends Animal {
    @Override
    void makeSound() {
        System.out.println("Dog barks");
    }
}

public class OverWrite {
    public static void main(String[] args) {
        Animal animal = new Dog();
        animal.makeSound();  // 输出: Dog barks

        int[] arr={1,2};
        int[] arr1=arr.clone();
        int[] arr2=arr;
        System.out.println("arr = " + arr+"\thashCode:\t"+arr.hashCode()+"\tclass:  "+arr.getClass());
        System.out.println("arr2 = " + arr2+"\thashCode:\t"+arr2.hashCode()+"\tclass:  "+arr2.getClass());
        System.out.println("arr1 = " + arr1+"\thashCode:\t"+ arr1.hashCode()+"\tclass:  "+arr1.getClass());
        arr[1]=3;
        System.out.println("arr[1]="+arr[1]);
        System.out.println("arr2[1]="+arr2[1]);
        System.out.println("arr1[1]="+arr1[1]);
        Integer[] arr3={1,3,4,5};
        System.out.println("arr3 = " + arr3);

    }
}
